package org.example.aitest.utils;

import java.util.Map;

public class TypeMapper {
    private static final Map<String, String> DB_TYPE_MAPPING = Map.of(
        "VARCHAR", "String",
        "BIGINT", "Long",
        "INT", "Integer",
        "DATETIME", "LocalDateTime",
        "TEXT", "String"
    );
    public static String mapToJavaType(String dbType) {
        String baseType = dbType.split("\\(")[0].toUpperCase();
        return DB_TYPE_MAPPING.getOrDefault(baseType, "Object");
    }
}